<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkComboBoxText</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 3 参考手册">
<link rel="up" href="MenusAndCombos.html" title="菜单、组合框和工具栏">
<link rel="prev" href="gtk3-GtkComboBox.html" title="GtkComboBox">
<link rel="next" href="gtk3-GtkMenu.html" title="GtkMenu">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gtk3-GtkComboBox.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="MenusAndCombos.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 3 参考手册</th>
<td><a accesskey="n" href="gtk3-GtkMenu.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk3-GtkComboBoxText.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gtk3-GtkComboBoxText.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gtk3-GtkComboBoxText"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-GtkComboBoxText.top_of_page"></a>GtkComboBoxText</span></h2>
<p>GtkComboBoxText — A simple, text-only combo box</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk3-GtkComboBoxText.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

struct              <a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText">GtkComboBoxText</a>;
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-new" title="gtk_combo_box_text_new ()">gtk_combo_box_text_new</a>              (<em class="parameter"><code><span class="type">void</span></code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-new-with-entry" title="gtk_combo_box_text_new_with_entry ()">gtk_combo_box_text_new_with_entry</a>   (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-append" title="gtk_combo_box_text_append ()">gtk_combo_box_text_append</a>           (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *id</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-prepend" title="gtk_combo_box_text_prepend ()">gtk_combo_box_text_prepend</a>          (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *id</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-insert" title="gtk_combo_box_text_insert ()">gtk_combo_box_text_insert</a>           (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> position</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *id</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-append-text" title="gtk_combo_box_text_append_text ()">gtk_combo_box_text_append_text</a>      (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-prepend-text" title="gtk_combo_box_text_prepend_text ()">gtk_combo_box_text_prepend_text</a>     (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-insert-text" title="gtk_combo_box_text_insert_text ()">gtk_combo_box_text_insert_text</a>      (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> position</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-remove" title="gtk_combo_box_text_remove ()">gtk_combo_box_text_remove</a>           (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> position</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-remove-all" title="gtk_combo_box_text_remove_all ()">gtk_combo_box_text_remove_all</a>       (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>);
<a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-get-active-text" title="gtk_combo_box_text_get_active_text ()">gtk_combo_box_text_get_active_text</a>  (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gtk3-GtkComboBoxText.description"></a><h2>Description</h2>
<p>
A GtkComboBoxText is a simple variant of <a class="link" href="gtk3-GtkComboBox.html#GtkComboBox" title="struct GtkComboBox"><span class="type">GtkComboBox</span></a> that hides
the model-view complexity for simple text-only use cases.
</p>
<p>
To create a GtkComboBoxText, use <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-new" title="gtk_combo_box_text_new ()"><code class="function">gtk_combo_box_text_new()</code></a> or
<a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-new-with-entry" title="gtk_combo_box_text_new_with_entry ()"><code class="function">gtk_combo_box_text_new_with_entry()</code></a>.
</p>
<p>
You can add items to a GtkComboBoxText with
<a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-append-text" title="gtk_combo_box_text_append_text ()"><code class="function">gtk_combo_box_text_append_text()</code></a>, <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-insert-text" title="gtk_combo_box_text_insert_text ()"><code class="function">gtk_combo_box_text_insert_text()</code></a>
or <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-prepend-text" title="gtk_combo_box_text_prepend_text ()"><code class="function">gtk_combo_box_text_prepend_text()</code></a> and remove options with
<a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-remove" title="gtk_combo_box_text_remove ()"><code class="function">gtk_combo_box_text_remove()</code></a>.
</p>
<p>
If the GtkComboBoxText contains an entry (via the 'has-entry' property),
its contents can be retrieved using <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-get-active-text" title="gtk_combo_box_text_get_active_text ()"><code class="function">gtk_combo_box_text_get_active_text()</code></a>.
The entry itself can be accessed by calling <a class="link" href="gtk3-GtkBin.html#gtk-bin-get-child" title="gtk_bin_get_child ()"><code class="function">gtk_bin_get_child()</code></a> on the
combo box.
</p>
<p>
</p>
<div class="refsect2">
<a name="GtkComboBoxText-BUILDER-UI"></a><h3>GtkComboBoxText as GtkBuildable</h3>
<p>
The GtkComboBoxText implementation of the GtkBuildable interface
supports adding items directly using the &lt;items&amp;gt element
and specifying &lt;item&amp;gt elements for each item. Each &lt;item&amp;gt
element supports the regular translation attributes "translatable",
"context" and "comments".
</p>
<p>
</p>
<div class="example">
<a name="id3569025"></a><p class="title"><b>Example 67. A UI definition fragment specifying GtkComboBoxText items</b></p>
<div class="example-contents"><pre class="programlisting">
&lt;object class="GtkComboBoxText"&gt;
  &lt;items&gt;
    &lt;item translatable="yes"&gt;Factory&lt;/item&gt;
    &lt;item translatable="yes"&gt;Home&lt;/item&gt;
    &lt;item translatable="yes"&gt;Subway&lt;/item&gt;
  &lt;/items&gt;
&lt;/object&gt;
</pre></div>
</div>
<p><br class="example-break">
</p>
</div>
<p>
</p>
</div>
<div class="refsect1">
<a name="gtk3-GtkComboBoxText.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkComboBoxText"></a><h3>struct GtkComboBoxText</h3>
<pre class="programlisting">struct GtkComboBoxText {
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-new"></a><h3>gtk_combo_box_text_new ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_combo_box_text_new              (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Creates a new <a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a>, which is a <a class="link" href="gtk3-GtkComboBox.html#GtkComboBox" title="struct GtkComboBox"><span class="type">GtkComboBox</span></a> just displaying
strings. See <code class="function">gtk_combo_box_entry_new_with_text()</code>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A new <a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-new-with-entry"></a><h3>gtk_combo_box_text_new_with_entry ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_combo_box_text_new_with_entry   (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Creates a new <a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a>, which is a <a class="link" href="gtk3-GtkComboBox.html#GtkComboBox" title="struct GtkComboBox"><span class="type">GtkComboBox</span></a> just displaying
strings. The combo box created by this function has an entry.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-append"></a><h3>gtk_combo_box_text_append ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_combo_box_text_append           (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *id</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>);</pre>
<p>
Appends <em class="parameter"><code>text</code></em> to the list of strings stored in <em class="parameter"><code>combo_box</code></em>.
If <em class="parameter"><code>id</code></em> is non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then it is used as the ID of the row.
</p>
<p>
This is the same as calling <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-insert" title="gtk_combo_box_text_insert ()"><code class="function">gtk_combo_box_text_insert()</code></a> with a
position of -1.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>combo_box</code></em> :</span></p></td>
<td>A <a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>id</code></em> :</span></p></td>
<td>a string ID for this value, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td>
<td>A string</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-prepend"></a><h3>gtk_combo_box_text_prepend ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_combo_box_text_prepend          (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *id</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>);</pre>
<p>
Prepends <em class="parameter"><code>text</code></em> to the list of strings stored in <em class="parameter"><code>combo_box</code></em>.
If <em class="parameter"><code>id</code></em> is non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then it is used as the ID of the row.
</p>
<p>
This is the same as calling <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-insert" title="gtk_combo_box_text_insert ()"><code class="function">gtk_combo_box_text_insert()</code></a> with a
position of 0.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>combo_box</code></em> :</span></p></td>
<td>A <a class="link" href="gtk3-GtkComboBox.html#GtkComboBox" title="struct GtkComboBox"><span class="type">GtkComboBox</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>id</code></em> :</span></p></td>
<td>a string ID for this value, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td>
<td>a string</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-insert"></a><h3>gtk_combo_box_text_insert ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_combo_box_text_insert           (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> position</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *id</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>);</pre>
<p>
Inserts <em class="parameter"><code>text</code></em> at <em class="parameter"><code>position</code></em> in the list of strings stored in <em class="parameter"><code>combo_box</code></em>.
If <em class="parameter"><code>id</code></em> is non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then it is used as the ID of the row.  See
<span class="type">"id-column"</span>.
</p>
<p>
If <em class="parameter"><code>position</code></em> is negative then <em class="parameter"><code>text</code></em> is appended.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>combo_box</code></em> :</span></p></td>
<td>A <a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td>
<td>An index to insert <em class="parameter"><code>text</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>id</code></em> :</span></p></td>
<td>a string ID for this value, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td>
<td>A string to display</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 3.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-append-text"></a><h3>gtk_combo_box_text_append_text ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_combo_box_text_append_text      (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>);</pre>
<p>
Appends <em class="parameter"><code>text</code></em> to the list of strings stored in <em class="parameter"><code>combo_box</code></em>.
</p>
<p>
This is the same as calling <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-insert-text" title="gtk_combo_box_text_insert_text ()"><code class="function">gtk_combo_box_text_insert_text()</code></a> with a
position of -1.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>combo_box</code></em> :</span></p></td>
<td>A <a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td>
<td>A string</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-prepend-text"></a><h3>gtk_combo_box_text_prepend_text ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_combo_box_text_prepend_text     (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>);</pre>
<p>
Prepends <em class="parameter"><code>text</code></em> to the list of strings stored in <em class="parameter"><code>combo_box</code></em>.
</p>
<p>
This is the same as calling <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-insert-text" title="gtk_combo_box_text_insert_text ()"><code class="function">gtk_combo_box_text_insert_text()</code></a> with a
position of 0.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>combo_box</code></em> :</span></p></td>
<td>A <a class="link" href="gtk3-GtkComboBox.html#GtkComboBox" title="struct GtkComboBox"><span class="type">GtkComboBox</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td>
<td>A string</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-insert-text"></a><h3>gtk_combo_box_text_insert_text ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_combo_box_text_insert_text      (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> position</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>);</pre>
<p>
Inserts <em class="parameter"><code>text</code></em> at <em class="parameter"><code>position</code></em> in the list of strings stored in <em class="parameter"><code>combo_box</code></em>.
</p>
<p>
If <em class="parameter"><code>position</code></em> is negative then <em class="parameter"><code>text</code></em> is appended.
</p>
<p>
This is the same as calling <a class="link" href="gtk3-GtkComboBoxText.html#gtk-combo-box-text-insert" title="gtk_combo_box_text_insert ()"><code class="function">gtk_combo_box_text_insert()</code></a> with a <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
ID string.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>combo_box</code></em> :</span></p></td>
<td>A <a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td>
<td>An index to insert <em class="parameter"><code>text</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td>
<td>A string</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-remove"></a><h3>gtk_combo_box_text_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_combo_box_text_remove           (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> position</code></em>);</pre>
<p>
Removes the string at <em class="parameter"><code>position</code></em> from <em class="parameter"><code>combo_box</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>combo_box</code></em> :</span></p></td>
<td>A <a class="link" href="gtk3-GtkComboBox.html#GtkComboBox" title="struct GtkComboBox"><span class="type">GtkComboBox</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td>
<td>Index of the item to remove</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-remove-all"></a><h3>gtk_combo_box_text_remove_all ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_combo_box_text_remove_all       (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>);</pre>
<p>
Removes all the text entries from the combo box.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>combo_box</code></em> :</span></p></td>
<td>A <a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 3.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-get-active-text"></a><h3>gtk_combo_box_text_get_active_text ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             gtk_combo_box_text_get_active_text  (<em class="parameter"><code><a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>);</pre>
<p>
Returns the currently active string in <em class="parameter"><code>combo_box</code></em>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
if none is selected. If <em class="parameter"><code>combo_box</code></em> contains an entry, this
function will return its contents (which will not necessarily
be an item from the list).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>combo_box</code></em> :</span></p></td>
<td>A <a class="link" href="gtk3-GtkComboBoxText.html#GtkComboBoxText" title="struct GtkComboBoxText"><span class="type">GtkComboBoxText</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a newly allocated string containing the currently
active text. Must be freed with <a href="../glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
</div>
<div class="refsect1">
<a name="gtk3-GtkComboBoxText.see-also"></a><h2>See Also</h2>
<a class="link" href="gtk3-GtkComboBox.html#GtkComboBox" title="struct GtkComboBox"><span class="type">GtkComboBox</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>